package labox.innovation.gameserver.model.base;

/**
 * 这个类定义了整个游戏世界所有的职业<BR><BR>
 *
 */
public enum ClassId {

	/**
	 * 金刚
	 */
	fighter(0x00, false, Race.HUMAN, "金刚"),//0

	/**
	 * 御剑
	 */
	taoist(0x02, true, true, Race.HUMAN, "御剑"),//2

	/**
	 * 降雷
	 */
	mage(0x04, true, Race.HUMAN, "降雷"), //4

	/**
	 * 罗刹
	 */
	elffighter(0x10, false, Race.ELF, "罗刹"),//16

	/**
	 * 幽冥
	 */
	elftaoist(0x12, true, true, Race.ELF, "幽冥"),//18

	/**
	 * 勾魂
	 */
	elfmage(0x14, true, Race.ELF, "勾魂"); //20

	/** 职业ID */
	private final int _id;

	/** 职业是否是魔法型 */
	private final boolean _isMage;

	/** 职业是否是召唤型 */
	private final boolean _isSummoner;

	/** 这个职业所属的种族*/
	private final Race _race;

	private final String _name;

	/**
	 * Constructor of ClassId.<BR><BR>
	 */
	private ClassId(int pId, boolean pIsMage, Race pRace, String name) {
		_id = pId;
		_isMage = pIsMage;
		_isSummoner = false;
		_race = pRace;
		_name = name;
	}

	/**
	 * Constructor of ClassId.<BR><BR>
	 */
	private ClassId(int pId, boolean pIsMage, boolean pIsSummoner, Race pRace, String name) {
		_id = pId;
		_isMage = pIsMage;
		_isSummoner = pIsSummoner;
		_race = pRace;
		_name = name;
	}

	/**
	 * Return the Identifier of the Class.<BR><BR>
	 */
	public final int getId() {
		return _id;
	}

	/**
	 * Return True if the class is a mage class.<BR><BR>
	 */
	public final boolean isMage() {
		return _isMage;
	}

	/**
	 * Return True if the class is a summoner class.<BR><BR>
	 */
	public final boolean isSummoner() {
		return _isSummoner;
	}

	/**
	 * Return the Race object of the class.<BR><BR>
	 */
	public final Race getRace() {
		return _race;
	}

	public final String getName() {
		return _name;
	}

	public final static ClassId getClassId(int id) {
		switch (id) {
		case 0x00:
			return fighter;
		case 0x02:
			return taoist;
		case 0x04:
			return mage;
		case 0x10:
			return elffighter;
		case 0x12:
			return elftaoist;
		case 0x14:
			return elfmage;
		default:
			return fighter;
		}
	}

}
